package vip.xiaomoli.validator.util;

import cn.hutool.core.util.ReflectUtil;

public class SpringBeanUtil {

    public static Object genericInvoke (
            Class<?> apiClass, String methodName, Object... args
    ) {
        Object bean = ApplicationContextHelper.getBean(apiClass);
        if (null == bean) bean = ApplicationContextHelper.getDubboBean(apiClass);
        return ReflectUtil.invoke(bean, methodName, args);
    }

}
